﻿import cgi
import os 
#from google.appengine.ext import db
#from google.appengine.ext.webapp import template
from google.appengine.ext import webapp                                        
from google.appengine.ext.webapp.util import run_wsgi_app                      
import logging                                                                 
#from datetime import date
#import datetime 
from StringIO import StringIO                                                  
import traceback
import simplejson
import xmlrpclib
from xmlrpcserver import XmlRpcServer
#from google.appengine.api import users
from decimal import *

from xmlWs import XmlUtilities
from jsonWs import JsonUtilities

from controllers import *

openIdProviders = (
    'Gmail.com', # shorter alternative: "Gmail.com"
    # add more here
)
       
application = webapp.WSGIApplication([                                          
            ('/', Home.Main),
            ('/RegisterUser',Register.RegisterUser),
            ('/AddAppForm',Application.AddApp),
            ('/Admin',Admin.AddSource),
            ('/AddApp',Application.UploadHandler),
            ('/AddSource',Admin.UploadHandler1),
            ('/MyApp',Application.MyApp),
            ('/app/([^/]+)?',Application.ServeHandlerApp),
            ('/source/([^/]+)?',Admin.ServeHandlerApp),
            ('/icon/([^/]+)?',Application.ServerHandlerIcon),
            ('/screen/([^/]+)?',Application.ServerHandlerScreen),
            ('/xmlrpc/', XmlUtilities.XMLRpcHandler),
            ], debug=True)


def main():
  run_wsgi_app(application)                                                    
        
if __name__ == "__main__":
    main()
